#include<stdio.h>

int reverse( int number )
{
    int rebmun = 0;
    int a = 1; 
    int b = 0;

    if (number<0)
    {
        b = 1;
        number = -number;
    }
    
    for (int i = 10; number/i >= 1; i *= 10)
    {
        a++;
    }
    
    int j = 1;
    for (int i = 0; i < a - 1; i++)
    {
        j = j*10;
    }
    
    for (int i = 0; i < a; i++)
    {
        rebmun  += (number%10)*j;
        number = number/10;
        j = j/10;
    }
    
    if (b == 1)
    {
        rebmun = -rebmun;
    }
    

    
    return rebmun;
}


int main(){    int n;    scanf("%d", &n);    printf("%d\n", reverse(n));    return 0;
}